// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.2.1

package Demo;

public final class PrinterPrxHelper extends Ice.ObjectPrxHelperBase implements PrinterPrx
{
    public int
    calcOneStep()
    {
        return calcOneStep(null, false);
    }

    public int
    calcOneStep(java.util.Map<String, String> __ctx)
    {
        return calcOneStep(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private int
    calcOneStep(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("calcOneStep");
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                return __del.calcOneStep(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public BodyStruct[]
    getBodyStructList()
    {
        return getBodyStructList(null, false);
    }

    public BodyStruct[]
    getBodyStructList(java.util.Map<String, String> __ctx)
    {
        return getBodyStructList(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private BodyStruct[]
    getBodyStructList(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("getBodyStructList");
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                return __del.getBodyStructList(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    initRandomMultiBodySystem()
    {
        initRandomMultiBodySystem(null, false);
    }

    public void
    initRandomMultiBodySystem(java.util.Map<String, String> __ctx)
    {
        initRandomMultiBodySystem(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    initRandomMultiBodySystem(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.initRandomMultiBodySystem(__ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setDeltaT(int deltaT)
    {
        setDeltaT(deltaT, null, false);
    }

    public void
    setDeltaT(int deltaT, java.util.Map<String, String> __ctx)
    {
        setDeltaT(deltaT, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setDeltaT(int deltaT, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setDeltaT(deltaT, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setLowerLimitMass(int lowLMass)
    {
        setLowerLimitMass(lowLMass, null, false);
    }

    public void
    setLowerLimitMass(int lowLMass, java.util.Map<String, String> __ctx)
    {
        setLowerLimitMass(lowLMass, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setLowerLimitMass(int lowLMass, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setLowerLimitMass(lowLMass, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setLowerLimitRadii(int lowLRadii)
    {
        setLowerLimitRadii(lowLRadii, null, false);
    }

    public void
    setLowerLimitRadii(int lowLRadii, java.util.Map<String, String> __ctx)
    {
        setLowerLimitRadii(lowLRadii, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setLowerLimitRadii(int lowLRadii, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setLowerLimitRadii(lowLRadii, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setMassCentralBody(double massCBody)
    {
        setMassCentralBody(massCBody, null, false);
    }

    public void
    setMassCentralBody(double massCBody, java.util.Map<String, String> __ctx)
    {
        setMassCentralBody(massCBody, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setMassCentralBody(double massCBody, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setMassCentralBody(massCBody, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setNumberOfBodies(int numOfBodies)
    {
        setNumberOfBodies(numOfBodies, null, false);
    }

    public void
    setNumberOfBodies(int numOfBodies, java.util.Map<String, String> __ctx)
    {
        setNumberOfBodies(numOfBodies, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setNumberOfBodies(int numOfBodies, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setNumberOfBodies(numOfBodies, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setSpaceCircumferenceLowerLimit(int spaceCirLowL)
    {
        setSpaceCircumferenceLowerLimit(spaceCirLowL, null, false);
    }

    public void
    setSpaceCircumferenceLowerLimit(int spaceCirLowL, java.util.Map<String, String> __ctx)
    {
        setSpaceCircumferenceLowerLimit(spaceCirLowL, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setSpaceCircumferenceLowerLimit(int spaceCirLowL, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setSpaceCircumferenceLowerLimit(spaceCirLowL, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setSpaceCircumferenceUpperLimit(int spaceCirUppL)
    {
        setSpaceCircumferenceUpperLimit(spaceCirUppL, null, false);
    }

    public void
    setSpaceCircumferenceUpperLimit(int spaceCirUppL, java.util.Map<String, String> __ctx)
    {
        setSpaceCircumferenceUpperLimit(spaceCirUppL, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setSpaceCircumferenceUpperLimit(int spaceCirUppL, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setSpaceCircumferenceUpperLimit(spaceCirUppL, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setUpperLimitMass(int uppLMass)
    {
        setUpperLimitMass(uppLMass, null, false);
    }

    public void
    setUpperLimitMass(int uppLMass, java.util.Map<String, String> __ctx)
    {
        setUpperLimitMass(uppLMass, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setUpperLimitMass(int uppLMass, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setUpperLimitMass(uppLMass, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public void
    setUpperLimitRadii(int uppLRadii)
    {
        setUpperLimitRadii(uppLRadii, null, false);
    }

    public void
    setUpperLimitRadii(int uppLRadii, java.util.Map<String, String> __ctx)
    {
        setUpperLimitRadii(uppLRadii, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setUpperLimitRadii(int uppLRadii, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate();
                _PrinterDel __del = (_PrinterDel)__delBase;
                __del.setUpperLimitRadii(uppLRadii, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, __cnt);
            }
        }
    }

    public static PrinterPrx
    checkedCast(Ice.ObjectPrx __obj)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (PrinterPrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::Demo::Printer"))
                {
                    PrinterPrxHelper __h = new PrinterPrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static PrinterPrx
    checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (PrinterPrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::Demo::Printer", __ctx))
                {
                    PrinterPrxHelper __h = new PrinterPrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static PrinterPrx
    checkedCast(Ice.ObjectPrx __obj, String __facet)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::Demo::Printer"))
                {
                    PrinterPrxHelper __h = new PrinterPrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static PrinterPrx
    checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::Demo::Printer", __ctx))
                {
                    PrinterPrxHelper __h = new PrinterPrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static PrinterPrx
    uncheckedCast(Ice.ObjectPrx __obj)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            PrinterPrxHelper __h = new PrinterPrxHelper();
            __h.__copyFrom(__obj);
            __d = __h;
        }
        return __d;
    }

    public static PrinterPrx
    uncheckedCast(Ice.ObjectPrx __obj, String __facet)
    {
        PrinterPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            PrinterPrxHelper __h = new PrinterPrxHelper();
            __h.__copyFrom(__bb);
            __d = __h;
        }
        return __d;
    }

    protected Ice._ObjectDelM
    __createDelegateM()
    {
        return new _PrinterDelM();
    }

    protected Ice._ObjectDelD
    __createDelegateD()
    {
        return new _PrinterDelD();
    }

    public static void
    __write(IceInternal.BasicStream __os, PrinterPrx v)
    {
        __os.writeProxy(v);
    }

    public static PrinterPrx
    __read(IceInternal.BasicStream __is)
    {
        Ice.ObjectPrx proxy = __is.readProxy();
        if(proxy != null)
        {
            PrinterPrxHelper result = new PrinterPrxHelper();
            result.__copyFrom(proxy);
            return result;
        }
        return null;
    }
}
